"""
Author: HuWen
@file: page_enterprise_drawing_information.py
@dateTime: 2025/7/9 15:14
加油加油！！！
"""
from playwright.sync_api import Page, expect, sync_playwright
from common.base_page import BasePage
from locators.basicSecurityInformation.loc_enterprise_drawing_information import EnterpriseDrawingInformation


class EnterpriseDrawingInfo(BasePage):

    def __init__(self, page: Page):
        super().__init__(page)
        self.switch_menu('安全基础管理')
    def page_enterprise_drawing_information_add(self):
        self.click(EnterpriseDrawingInformation.loc_tab)
        self.click(EnterpriseDrawingInformation.loc_add)

        self.page.get_by_label("新增").get_by_text("请选择 图件类型").click()
        self.select(EnterpriseDrawingInformation.loc_add_map_type)

    def keep_browser_open(self):
            # 这里可根据需求加等待，或直接让调用方控制
        input("按回车继续...")


    # 新增暂时不实现，附件上传role空
    def page_enterprise_drawing_information_edit(self):
        self.click(EnterpriseDrawingInformation.loc_tab)
        self.click(EnterpriseDrawingInformation.loc_view)



        pass

    def page_enterprise_drawing_information_view(self):
        pass

    def page_enterprise_drawing_information_remove(self):
        pass

    def page_enterprise_drawing_information_download(self):
        pass

    def page_enterprise_drawing_information_batchdownload(self):
        pass
if __name__ == "__main__":
        with sync_playwright() as p:
            browser = p.chromium.launch(headless=False)
            page = browser.new_page()
            drawing_page = EnterpriseDrawingInfo(page)
            drawing_page.page_enterprise_drawing_information_add()
            # 调用阻塞方法
            drawing_page.keep_browser_open()
            browser.close()
